package reflect;

import reflect.annotations.AutoRunClass;
import reflect.annotations.AutoRunMethod;

@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 22;
    public Person (){}
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    @AutoRunMethod(2)
    public void SayHello(){
        System.out.println(name + "Hello");
    }
    @AutoRunMethod(2)
    public void SayHi(){
        System.out.println(name + "Hi");
    }
    public void DoSome(){
        System.out.println(name + "做某事");
    }
    @AutoRunMethod
    public void watchTV(){
        System.out.println(name + "看电视");
    }
    public void study(){
        System.out.println(name + "在学习");
    }
    @AutoRunMethod
    public void playGame(){
        System.out.println(name + "在玩游戏");
    }
    public void sing(){
        System.out.println(name + "在唱歌");
    }
    public void say(String info){
        System.out.println(name + ":" + info);
    }
    public void say(String info , int count){
        for (int i = 0; i < count; i++) {
            System.out.println(name + ":" + info);
        }
    }
    private void here(){
        System.out.println("我是私有方法here");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
